#ifndef PARTICLE_H
#define PARTICLE_H

#include "vector3d.h"
#include "color.h"
#include <vector>
#include <utility>
#include <iostream>

class Face;
class Spring;

class Particle{
	public:
		Particle(int = 0);
		Particle(int, double, double, double, const Vector3D &, const Color &);
		Particle(int, double, double, const Vector3D &, const Color &);
		Particle(int, const Vector3D &, const Color &);
		~Particle();

        int getID() const;

		void reset();

		bool isSelected() const {return selected;};
		void select(bool _b) {selected = _b;};

		Color getColor() const;
		const Color &getActualColor() const;
		void setColor(const Color &);

		double getMass() const;
		void setMass(double);

		double getKd() const;
		void setKd(double);

		double getMiC() const;
		void setMiC(double);

		void setTextureCoord(double _u, double _v){textureCoord.first = _u; textureCoord.second = _v;};
		double getTextureCoordU() const {return textureCoord.first;};
		double getTextureCoordV() const {return textureCoord.second;};

		Vector3D getPosition() const;
		void setPosition(const Vector3D &);

		Vector3D getVelocity() const;
		void setVelocity(const Vector3D &);

		std::vector<Face *> getFaces() {return faces;};
		void addFace(Face *_f) {faces.push_back(_f);};

		std::vector<Spring *> getSprings() {return springs;};
		void addSpring(Spring *_s) {springs.push_back(_s);};

		void move(const Vector3D &);
		double area() const;

	private:
        int id;
        bool selected;
		Color color;
		double mass;
		double kd, miC;
		std::pair<double, double> textureCoord;
		Vector3D position;
		Vector3D velocity;
		Vector3D initialPosition;
		Vector3D initialVelocity;
		std::vector<Face *> faces;
		std::vector<Spring *> springs;
};

#endif
